from datetime import datetime


class FileNotSupportedException(Exception):
    """文件类型不支持异常"""

    def __init__(self, file_type: str, file_name: str = None, extra_info: str = None):
        self.file_type = file_type
        self.file_name = file_name
        self.extra_info = extra_info
        self.timestamp = str(datetime.now())

        # 组合错误信息
        message = f"不支持的文件类型: {file_type}"
        if file_name:
            message += f"（文件名: {file_name}）"
        if extra_info:
            message += f"，{extra_info}"

        super().__init__(message)
